package cz.data.domain.market.model.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;

@Getter
@Setter
@ToString
public class TableApiSettings implements Serializable {
    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "访问控制", notes = "@DataInner.Access枚举")
    private String access;
    @ApiModelProperty(value = "接口验签")
    private Boolean verSign = Boolean.FALSE;
    @ApiModelProperty(value = "生成接口")
    private List<String> operates;

    @Getter
    @AllArgsConstructor
    public enum Operate {
        Insert("1", "新增"),
        Update("2", "更新"),
        Delete("3", "删除"),
        GetById("4", "详情"),
        Page("5", "分页")
        ;

        private final String value;
        private final String title;

        public boolean equalsValue(String value) {
            return this.value.equals(value);
        }
    }
}
